package com.zdzx.common.config;

import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.jmx.support.RegistrationPolicy;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

@Configuration
@ServletComponentScan
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING) // 解决jmx重复注册bean的问题
//@EnableEurekaClient
//@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
public class BaseConfig {

	
	@Bean
	public ObjectMapper serializingObjectMapper() {
	  ObjectMapper objectMapper = new ObjectMapper();
	  objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
	  objectMapper.registerModule(new JavaTimeModule());
	  return objectMapper;
	}
	
}
